package cn.gdk.gaodekecc.service.impl;

import cn.gdk.gaodekecc.domain.MoveUser;
import cn.gdk.gaodekecc.mapper.MoveUserMapper;
import cn.gdk.gaodekecc.result.JSONResult;
import cn.gdk.gaodekecc.service.IMoveUserService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author director
 * @since 2022-11-25
 */
@Service
public class MoveUserServiceImpl extends ServiceImpl<MoveUserMapper, MoveUser> implements IMoveUserService {

    @Override
    public JSONResult movieTicketViewing(Long movieId, Long userId) {
        EntityWrapper<MoveUser> wrapper = new EntityWrapper<>();
        wrapper.eq("user_id",userId);
        wrapper.eq("movie_ticket_id",movieId);
        MoveUser moveUser = selectOne(wrapper);
        return JSONResult.success(moveUser);
    }
}
